package com.water.wfo.component.api.utils;

import com.water.wfo.component.api.domain.CookieToken;
import org.apache.commons.codec.binary.Base64;

/**
 * packageName com.water.wfo.component.api.utils
 *
 * @author
 * @className TokenMarshal(处以class为网)
 * @date 2025/1/17
 * @description T0D0
 */
public class TokenMarshal {
    private TokenMarshal(){}

    public static String marshal(CookieToken token){
        return new String(Base64.encodeBase64String(token.toBytes()));
    }

    public static CookieToken unMarshal(String tokenStr){
        return new CookieToken(Base64.decodeBase64(tokenStr));
    }
}
